<?php

namespace App\maguttiCms\Notifications;

use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;

class AdminResetPasswordNotification extends Notification
{
	public $token;

	/**
	 * Create a notification instance.
	 *
	 * @param  string  $token
	 * @return void
	 */
	public function __construct($token)
	{
		$this->token = $token;
	}

	/**
	 * Get the notification's delivery channels.
	 *
	 * @param  mixed  $notifiable
	 * @return array
	 */
	public function via($notifiable)
	{
		return ['mail'];
	}

	/**
	 * Get the mail representation of the notification.
	 *
	 * @param  mixed  $notifiable
	 * @return \Illuminate\Notifications\Messages\MailMessage
	 */
	public function toMail($notifiable): MailMessage
    {
		return (new MailMessage)
			->subject(trans('passwords.mail_reset_subject').' - '.config('maguttiCms.website.option.app.name'))
			->greeting(trans('website.mail_message.greeting'))
			->line(trans('passwords.mail_reset_body'))
			->action(trans('passwords.mail_reset_button'), url('admin/password/reset').'/'.$this->token)
			->line(trans('passwords.mail_reset_footer'));
	}

	/**
	 * Get the array representation of the notification.
	 *
	 * @param  mixed  $notifiable
	 * @return array
	 */
	public function toArray($notifiable)
	{
		return [
			//
		];
	}
}
